<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加站点</title>
</head>
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
<body>
    <form id="myForm">
        returnUrl：<input id="returnUrl" name="returnUrl" type="text" style="width: 320px">
        email：<input id="email" name="email" type="text" style="width: 320px">
        <input type="button" value="保存" onclick="save()">
    </form>
</body>
<script>

    function save() {
        $.ajax({
            url : '/back/host/addHost',
            type : 'POST',
            dataType : 'JSON',
            data : {
                returnUrl : $("#returnUrl").val() ,
                email : $("#email").val()
            },
            success : function(result) {
                if(result.code != 200) {
                    alert(result.msg);
                }else {
                    setTimeout(window.location.href = "/back/host/hosts" , 3000);
                }
            }
        });
    }
</script>
</html>